<!--
功能：个人缴费记录查询,
作者：RanSheng,
邮箱：1534677527@qq.com",
时间：2021/6/6 23:42,
版本：v1.0,
修改记录：,
修改内容：,
修改人员：,
修改时间：,
-->
<template>
  <div class="box">
    <div class="table">
      <el-table
        :data="tableData"
        stripe
        border
        style="width: 100%">
        <el-table-column
          type="index"
          label="编号">
        </el-table-column>
        <el-table-column
          v-for="t in table"
          :key="t.id"
          :label="t.label"
          :prop="t.prop">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import {message} from "@/utils/age";

export default {
  name: "MyCost",
  data() {
    return {
      tableData: [],
      table:[{
        id:1,
        label:'缴费日期',
        prop:'costtime'
      },{
        id:2,
        label:'缴费金额',
        prop:'money'
      },{
        id:3,
        label:'缴费内容',
        prop:'content'
      },{
        id:4,
        label:'缴费人',
        prop:'user.name'
      }]
    };
  },
  components: {},
  computed: {},
  mounted() {
    this.findMyCostAll()
  },
  methods: {
    //  个人缴费记录查询
    findMyCostAll() {
      this.$http.get('user/record').then(response => {
        this.tableData=response.data
        message("success", "成功")
      }).catch(err => {
        message("error", "请求参数错误")
      })
    }
  },
  watch: {},
  destroyed() {

  },
}
</script>

<style scoped>
.box {
  margin-top: 50px;
  width: 100%;
  min-height: 200px;
  /*background-color: pink;*/
}

/*表格内容居中显示*/
.table /deep/ .el-table th > .cell {
  text-align: center;
}

.table /deep/ .el-table .cell {
  text-align: center;
}

</style>
